var map;
var geoXml; 

function initialize(kmlUrl, latitude, longitude, altitude) {
    if (GBrowserIsCompatible()) {
        
        map = new GMap2(document.getElementById("map_canvas")); 
        map.setCenter(new GLatLng(latitude,longitude), altitude); 
        map.addControl(new GLargeMapControl());
        
        geoXml = new GGeoXml(kmlUrl, function() {
            if (geoXml.loadedCorrectly()) {
                geoXml.gotoDefaultViewport(map);
            }
        });
        map.addOverlay(geoXml);
    }
} 